/*
 * terminator_despacho.cpp
 *
 */

#include "../common/Argv.h"
#include "../middleware/CommunicationDespacho.h"
#include "../middleware/CommunicationRobot16.h"
#include "../middleware/CommunicationAdpt.h"
#include "../middleware/CommunicationVendedor.h"
#include "../channel_common/ChannelInterface.h"
#include "../control/clienteCommon.h"

int main(int argc, char**argv)
{
	std::string hostName = "cliente_pc";
	//Toma argumentos (main)
	Argv inArgs(argv);

	//Si se le pasa un argumento tomarlo como hostname
	if (inArgs.getArgc() == 2)
		hostName = inArgs.getArg(1);

	channel::ChannelInterface::disconnectChannel(hostName);
	channel::ChannelInterface::destroy(hostName);

	middleware::CommunicationVendedor::destroy(middleware::CommunicationVendedor::CLIENTE,hostName);
	middleware::CommunicationDespacho::destroy(middleware::CommunicationDespacho::CLIENTE,hostName);
}
